package com.whfc.ms.api.base.controller;

import com.whfc.base.dto.AppExportDTO;
import com.whfc.common.base.BaseController;
import com.whfc.common.result.PageData;
import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.common.util.SessionAttr;
import com.whfc.fuum.entity.SysUser;
import com.whfc.ms.api.base.service.MsAppExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 导出记录
 * @Author hw
 * @Date 2021-07-22 11:54
 * @Version 1.0
 */
@RestController
@RequestMapping("/ms/api/export")
public class AppExportController extends BaseController {

    @Autowired
    private MsAppExportService exportService;

    @GetMapping(value = "/list")
    public Result list(@SessionAttribute(SessionAttr.MS_USER) SysUser user,
                       @RequestParam("deptId") Integer deptId,
                       @RequestParam("pageNum") Integer pageNum,
                       @RequestParam("pageSize") Integer pageSize) {
        logger.info("导出记录列表(分页)：loginer:{},deptId:{},pageNum:{},pageSize:{}",
                user.getUsername(), deptId, pageNum, pageSize);
        PageData<AppExportDTO> pageData = exportService.list(deptId, pageNum, pageSize);
        return ResultUtil.success(pageData);
    }
}
